import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { CourseStatusVO, CourseStatusForm, CourseStatusQuery } from '@/api/bclt/courseStatus/types';

/**
 * 查询视频播放状态列表
 * @param query
 * @returns {*}
 */

export const listCourseStatus = (query?: CourseStatusQuery): AxiosPromise<CourseStatusVO[]> => {
  return request({
    url: '/bclt/courseStatus/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询视频播放状态详细
 * @param id
 */
export const getCourseStatus = (id: string | number): AxiosPromise<CourseStatusVO> => {
  return request({
    url: '/bclt/courseStatus/' + id,
    method: 'get'
  });
};

/**
 * 新增视频播放状态
 * @param data
 */
export const addCourseStatus = (data: CourseStatusForm) => {
  return request({
    url: '/bclt/courseStatus',
    method: 'post',
    data: data
  });
};

/**
 * 修改视频播放状态
 * @param data
 */
export const updateCourseStatus = (data: CourseStatusForm) => {
  return request({
    url: '/bclt/courseStatus',
    method: 'put',
    data: data
  });
};

/**
 * 删除视频播放状态
 * @param id
 */
export const delCourseStatus = (id: string | number | Array<string | number>) => {
  return request({
    url: '/bclt/courseStatus/' + id,
    method: 'delete'
  });
};
